package at.main.gui;


import at.main.android.Graphics;
import at.main.util.AllImage;
import at.main.util.ManagerFont;

public class AboutPage {
	public static final String st[][] = {
		{"Giới thiệu chung","Game PacMan","Chơi 1 người","Phiên bản 0.1.1"},
		{"Deveploper : ","User 00"},
		{"Design : ","User 01"},
		{"Tester : ","User 02"},
		{"Bản quyền :","Công ty - ABCD -"}};

	public int x = 0;

	public int y = 0;

	public int lTimer = 0;

	public int lDislay = 0;

	public boolean isTranlate = false;

	public int iHeigtFont = 15;

	public AboutPage() {
		// x = MyCanvas.iWidth / 2;
		// y = MyCanvas.iHeight - 20;
		x = MyCanvas.iWidth / 2;
		lDislay = 10;
		y = 0;
		lTimer = 0;
	}

	public void paint(Graphics g) {
		g.setClip(0, 0, MyCanvas.iWidth, MyCanvas.iHeight);
		g.setColor(0x87CEFF);
		g.fillRect(0, 0, MyCanvas.iWidth, MyCanvas.iHeight);
		lTimer++;

		if (lTimer == 1) {
			lTimer = 0;
			lDislay--;
			if (lDislay < -(MyCanvas.iHeight))
				lDislay = 10;
		}
		y = lDislay;
		x = MyCanvas.iWidth / 2;
		for (int i = 0; i < st.length; i++) {
			for (int j = 0; j < st[i].length; j++) {
				if (j == 0) {
					ManagerFont.drawString(g, st[i][j].toString(), x, y
							+ iHeigtFont, 2, 2);

				} else {
					ManagerFont.drawString(g, st[i][j].toString(), x, y
							+ iHeigtFont, 2, 1);
				}
				y += 15;
			}
			y += 10;
		}

		// Ve nut quay lai
//		String s = "Quay lại";
//		g.setColor(0xBABABA);
//		g.fillRect(MyCanvas.iWidth - s.length() - 50, MyCanvas.iHeight - 15,
//				70, 15);
//		ManagerFont.drawString(g, s, MyCanvas.iWidth - s.length(),
//				MyCanvas.iHeight - 15, 1, 2);
		if (AllImage.img_again != null) {
			g.drawImage(AllImage.img_again, MyCanvas.iWidth- AllImage.img_again.getWidth(), MyCanvas.iHeight- AllImage.img_again.getHeight(), Graphics.TOP|Graphics.LEFT);
		}
	}

	public void update() {
		if (MyCanvas.keyHold[13]) {
			lDislay = 10;
			y = 0;
			MyCanvas.iCurrentPage = MyCanvas.k_MenuPage;
			MyCanvas.clearInput();
		}
	}
}
